This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 19, 2011, 12:52 PM
10 Posts

How do I data bind a computed field to a form field?

  • Category: Debugging
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags: computed,field,data,binding
  • Replies: 1
I have a simple custom control that is presenting a combobox of applications.  Once an application is selected, two computed fields compute the server the application resides on and the filepath to that application.  There is one other field that is a edit box.  The xpage seems to work fine, but I obviously missed something with the data binding because the two computed fields do not populate on the underlying document.  Below is what I have in the Value of each computed field.  How do I bind each computed field to the underlying field on the form?
 
Server Field (NOTE: I substituted SERVERNAME and FILEPATH instead of the actual values): 

var acronym = getComponent("appName1").getValue();

var db = new Array("SERVERNAME","FILEPATH");

var list = @DbLookup(db,"(By Acronym)", acronym, "CurrentServer");

if (@IsError(list))

return "Please select a valid acronym";

else

return list;

 
Filepath Field (NOTE: I substituted SERVERNAME and FILEPATH instead of the actual values): 
 

var acronym = getComponent("appName1").getValue();

var db = new Array("SERVERNAME","FILEPATH");

var filepath = @DbLookup(db,"(By Acronym)", acronym, "CurrentFilepath");

var filename = @DbLookup(db,"(By Acronym)", acronym, "CurrentFilename");

if (@IsError(filepath))

return db;

else

return filepath + "\\" + filename;

Is there some JS code I can add to do the binding here or do I do it somewhere else.  I'm new to JS, LS programmer, so, any tips, suggestions, etc. will be greatly appreciated.
 
Thanks in advance,
 
MJ   
Oct 19, 2011, 1:29 PM
272 Posts
Re: How do I data bind a computed field to a form field?
Hi,
 
you can compute the fields on your form. By using the computewithform="both" property of the document datasource, the fields will be computed then.
 
Hope this helps
Sven
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal